package com.echronos.finance.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 在线收单策略
 *
 * @Author wangyadong
 * @Date 2023/9/14 10:27
 * @ClassName AcquireReceiptOnlineEnums
 */
@Getter
@AllArgsConstructor
public enum AcquireReceiptOnlineEnums {
    MALL_ORDER(0, "常用订单"),
    SETTLEMENT_BATCH_ORDER(10, "结算单"),
    CREDIT_REPAYMENT_ORDER(11, "赊销还款单"),
    ;
    private Integer code;
    private String desc;

    /**
     * 根据code获取枚举信息
     *
     * @param code
     * @return
     */
    public static AcquireReceiptOnlineEnums getByCode(Integer code) {
        for (AcquireReceiptOnlineEnums enums : AcquireReceiptOnlineEnums.values()) {
            if (code.equals(enums.getCode())) {
                return enums;
            }
        }
        return MALL_ORDER;
    }
}
